<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<style>
.editor table {
	display: inline;
	vertical-align: top;
}

</style>
<div class="r_location">
	<i class="r_txtico"></i> 内容管理&gt; 会员管理 &gt; 修改会员
</div>
<form id="add_form" action="cms/member/modify"   method="post"  >
<input type="hidden" id="id" name="id" value="${data.id}" />

	<ul class="all_list">
		<li>
			<span class="all_title">会员名称：</span>
			<span>
				<input class="ui_input" id="memberName" validator='{"label":"名称","isDigit":false,"minLength":1,"maxLength":50}'  name="memberName" style="width:100px;" value="${data.memberName}"/>
			</span>
		</li>
		<li>
			<span class="all_title">会员等级：</span>
			<span>
				<input class="ui_input" id="integral" validator='{"label":"会员等级","isDigit":true,"minLength":1,"maxLength":50}'  name="memberLevel" style="width:100px;" value="${data.memberLevel}"/>
			</span>
		</li>
		<li>
			<span class="all_title">会员积分：</span>
			<span>
				<input class="ui_input" id="memberLevel" validator='{"label":"会员积分","isDigit":true,"minLength":1,"maxLength":50}'  name="integral" style="width:100px;" value="${data.integral}"/>
			</span>
		</li>
		<li>
			<span class="all_title">会员状态：</span>
			<span>
				<select id="stats" name="stats" class="ui_select">
					<option value="1" <c:if test="${data.stats == 1}">selected="selected"</c:if>>上架</option>
					<option value="2" <c:if test="${data.stats == 2}">selected="selected"</c:if>>下架</option>
				</select>
			</span>
		</li>
		<li class="editor"><span class="all_title">描述：</span> <span>
				<textarea id="content" name="remark"
					class="xheditor {tools:'FontSize,FontColor,Bold,Italic,Underline,Strikethrough,Fullscreen,Align,About',skin:'default',height:'300'}"
					rows="8" cols="80" style="width: 70%">${data.remark}
				</textarea> <span id="contentError"></span>
		</span></li>
		<li>
			<span class="all_title"></span>
			<span>
				<input type="button" id="addBtn" value="保存" class="btn_blue m-r15 submitBtn">
			</span>
		</li>
	</ul>
</form>
<script type="text/javascript">
	$(function(){
		function showDialog(url, options) {
			myDialog = art.dialog(options);// 初始化一个带有loading图标的空对话框
			$.post(url, options.param, function(data) {
				myDialog.content(data);
			});
		}
		$("#add_form").validator({}, {
			callback:function(data){
				if (!$('#memberName').val()) {
					alert("会员名称不能为空");
					return false;
				} 
				if (!$('#memberLevel').val()) {
					alert("会员等级不能为空");
					return false;
				}
				if (!$('#integral').val()) {
					alert("积分不能为空");
					return false;
				}
				if (!$('#stats').val()) {
					alert("状态不能为空");
					return false;
				}
				if (!$('#content').val()) {
					$('#contentError').html('内容不能为空!').addClass('frame_error');
					return false;
				} else {
					$('#contentError').html('').removeClass('frame_error');
				}
				if(!$('#id').val()){
					alert("id不能为空");
					return false;
				}
				$("#add_form").ajaxSubmit(function(data){
					if (data.success == 'succeed') {
						to_page('/cms/member/view/page');
					} else {
						art.dialog({icon: data.success,content: data.message,lock:true});
					}
				}); 
			}
		});
 	});
		
</script>